<template>
	<view class="profit" :style="{'--color':vuex_config.price}">
		<view class="banner-ff"></view>
		<view class="banner">
			<view class="content">
				<view class="content-item line">
					<view class="item-top">
						<text class="u-font-28">{{dataForm.level_count || 0}}</text>
						<text class="u-font-22" style="position: relative;bottom: 2rpx;padding-left: 6rpx;">人</text>
					</view>
					<view class="item-bottom">总参与人数</view>
				</view>
				<view class="content-item line">
					<view class="item-top">
						<text class="u-font-22" style="position: relative;bottom: 6rpx;">￥</text>
						<text class="u-font-28">{{$price(dataForm.total_commission)}}</text>
					</view>
					<view class="item-bottom">总收益</view>
				</view>
				<view class="content-item">
					<view class="item-top">
						<text class="u-font-22" style="position: relative;bottom: 6rpx;">￥</text>
						<text class="u-font-28">{{$price(dataForm.bonus_currency)}}</text>
					</view>
					<view class="item-bottom">奖金池</view>
				</view>
			</view>
		</view>
		<view class="list">
			<template v-if="dataForm.users_grade[0]">
				<view class="list-item" v-for="(item,index) in dataForm.users_grade" :key='index'>
					<view class="item-left">
						<view class="u-p-b-20">{{item.name}}</view>
						<view class="">已参与人数：{{item.users_count}}人</view>
					</view>
					<view class="item-right">
						<view class="right-price">
							<view class="price-icon">￥</view>
							<view class="">{{$price(item.commission_count)}}</view>
						</view>
						<view class="u-p-t-10">累计收益</view>
					</view>
				</view>
			</template>
			<view class="u-p-t-50" v-else>
				<u-empty  text="暂无数据" mode="list"></u-empty>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataForm:{
					users_grade:[]
				}
			}
		},
		onLoad(){
			this.initPage()
		},
		methods: {
			initPage(){
				this.$resPost('GetDividendStatistics',{
					business_id:this.vuex_business.pk_id
				}).then(res=>{
					this.dataForm = res.data
				})
			}
		}
	}
</script>
<style>
	page {
		background-color: #f5f5f5;
	}
</style>
<style lang="scss" scoped>
	.profit {
		.banner-ff {
			width: 100%;
			height: 40rpx;
			background-color: #fff;
		}

		.banner {
			width: 100%;
			height: 200rpx;
			background-image: url(../../../static/bg1.png);
			background-repeat: no-repeat;
			background-size: 100% 100%;
			margin-bottom: 20rpx;

			.content {
				width: 100%;
				display: flex;
				align-items: center;
				padding: 66rpx 30rpx 0;

				.content-item {
					flex: 1;
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					color: #fff;
					position: relative;
					&.line::after{
						content: '';
						width: 2rpx;
						height:40rpx;
						border-radius: 20rpx;
						background-color: #fff;
						position: absolute;
						top: 50%;
						right: 0;
						transform: translateY(-50%);
					}
					.item-top {
						display: flex;
						align-items: flex-end;
						padding-bottom: 10rpx;
					}

					.item-bottom {
						font-size: 24rpx;
					}
				}
			}
		}

		.list {
			width: 100%;
			padding: 0 30rpx;

			.list-item {
				width: 100%;
				border-radius: 20rpx;
				padding: 34rpx 100rpx;
				background-color: #fff;
				margin-bottom: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.item-left {
					display: flex;
					flex-direction: column;
					color: #999;
					font-size: 24rpx;
				}

				.item-right {
					display: flex;
					flex-direction: column;
					align-items: flex-end;
					font-size: 24rpx;
					color: #999;

					.right-price {
						display: flex;
						align-items: flex-end;
						color: var(--color);
						font-size: 36rpx;

						.price-icon {
							font-size: 22rpx;
							position: relative;
							bottom: 8rpx;
						}
					}
				}
			}
		}
	}
</style>
